﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace SGA
{
    public partial class MasterSGA : System.Web.UI.MasterPage
    {

        protected void Page_Load(object sender, EventArgs e)
        {
            string u = Page.User.Identity.Name;
            if (Page.User.Identity.IsAuthenticated)
            {
                if (Roles.IsUserInRole(u, "Admin"))
                {
                    ContextMenu.DataSourceID = "MenuAdmin";
                }
                else
                {
                    ContextMenu.DataSourceID = "MenuUser";
                }
            }
            ContextMenu.DataBind();
        }
    }
}